﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Besture.Bll;
using Besture.Common;
using Besture.Common.Helper;
using Besture.Model;

namespace Besture.UI.Portal.FindUserPwd
{
    public partial class FindUserPwdList2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitData();
            }
        }

        /// <summary>
        /// 初始化数据
        /// </summary>
        private void InitData()
        {
            UserBaseModel userBaseModel = new UserBaseDac().GetModel(Convert.ToInt32(EncryptHelper.Decrypt(StringHelper.Query("user"))));
            hidPhone.Value = userBaseModel.Phone;
            phone.InnerText = userBaseModel.Phone.Replace(userBaseModel.Phone.Substring(3, 4), "****");
        }

        /// <summary>
        /// 验证验证码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSub_Click(object sender, EventArgs e)
        {
            if (txtVerificationCode.Text.ToLower() != Session["registerPhoneCode"])
            {
                FunHelper.Alert(Page, "验证码错误！");
            }
            Response.Redirect("FindUserPwdList3.aspx?user=" + StringHelper.Query("user"));
        }
    }
}